<%@page import="com.xnx3.j2ee.Global" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.xnx3.com/java_xnx3/xnx3_tld" prefix="x" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<jsp:include page="../iw/common/head.jsp">
    <jsp:param name="title" value="文章列表"/>
</jsp:include>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" media="all">
<style>
    .body {
        margin: 0;
        padding: 0px;
        height: 100%;
        overflow: hidden;
    }

    .menu {
        width: 160px;
        height: 100%;
        background-color: #EAEDF1;
        position: absolute;
    }

    /* 左侧栏目列表的文字 */
    .layui-nav-tree .layui-nav-item a {
        color: #333;
    }

    /*鼠标移动到某项后的样式*/
    .layui-nav-tree .layui-nav-item a:hover:HOVER {
        background-color: #f4f6f8;
        color: #222;
    }

    /*子栏目*/
    .layui-nav-tree .layui-nav-item dl dd a {
        padding-left: 35px;
    }

    .dltitle {
        background-color: #EAEDF1;
    }

    .layui-nav-itemed > a, .layui-nav-tree .layui-nav-title a, .layui-nav-tree .layui-nav-title a:hover {
        background-color: #EAEDF1 !important;
        color: #222 !important;
    }

    .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th {
        line-height: 2.2;
        text-align: center;
    }

    .layui-nav-child dd {
        background-color: #EAEDF1;
    }

    .layui-nav .layui-nav-item .layui-nav-more {
        border-top-color: rgba(64, 34, 34, 0.7);
    }

    /*有二级栏目的，二级栏目伸缩的时候，右侧的小尖头的颜色*/
    .layui-nav .layui-nav-itemed .layui-nav-more {
        border-top-color: rgba(64, 34, 34, 0);
        border-color: transparent transparent #a42828;
    }

    th, td {
        text-align: center !important;
    }

    #xnx3_page {
        width: 100%;
        padding-top: 15px;
        padding-bottom: 20px;
    }

    #xnx3_page ul {
        width: 100%;
        text-align: center;
    }

    #xnx3_page ul li {
        display: inline-block;
        vertical-align: middle;
        border: 1px solid #e2e2e2;
        background-color: #fff;
        padding-right: 1px;
        padding-left: 1px;
    }

    #xnx3_page ul .xnx3_page_currentPage, #xnx3_page ul .xnx3_page_currentPage a {
        background-color: #009688;
        color: #fff;
    }

    #xnx3_page ul li a {
        padding: 0 15px;
        height: 30px;
        line-height: 30px;
        background-color: #fff;
        color: #333;
    }

   .layui-btn{
        background-color: #28a44d;
    }

    .iw_table th{
        font-size: 12px;
    }
    .iw_table td{
        font-size: 12px;
    }
    option{
        font-size: 12px;
    }
</style>

<div style="width:100%;height:100%; background-color: #fff; overflow-x: hidden;margin-left: 50px">

    <div style="width:100%;height:100%;position: absolute;word-wrap: break-word;border-right: 170px;box-sizing: border-box; padding-right: 10px; overflow-y: auto;overflow-x: hidden;">

        <table class="layui-table iw_table" style="margin-top: 50px">
            <thead>
            <tr>
                <th>编号</th>
                <th>轮播图</th>
                <th>发布时间</th>
                <th>修改时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${broadcastImgPath}" var="list">
                <tr>
                    <td></td>
                    <td><img src="<%=basePath%>${list.broadcastImgPath}"></td>
                    <td>${list.timestamps}</td>
                    <td>${list.modifyTime}</td>
                    <td>
                        <button class="layui-icon layui-btn layui-btn-sm" onclick="updateProduct(${list.id});">
                            &#xe642;
                        </button>
                        <button style="margin-left:10px;" onclick="deleteNews(${list.id})"
                                class="layui-icon layui-btn layui-btn-sm">&#xe640;
                        </button>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <!-- 通用分页跳转 -->
        <div class="page_all">
            <ul class="pagination" id="page"></ul>
        </div>
        <div style="font-size: 12px;margin-top: 10px;width: 500px">
            <div>操作按钮提示:</div>
            <div><i class="layui-icon">&#xe642;</i> &nbsp;：对轮播图进行修改</div>
            <div><i class="layui-icon">&#xe640;</i> &nbsp;：删除轮播图进行修改</div>
            <div>温馨提示：轮播图最多只能上传10张</div>
        </div>
    </div>
</div>

<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="http://118.25.235.213:8030/js/jqPaginator/src/js/jqPaginator.js"></script>

<script type="text/javascript">

    $(function () {
        var len = $('table tr').length;
        for (var i = 1; i < len; i++) {
            $('table tr:eq(' + i + ') td:first').text(i);
        }

    });

    layui.use('element', function () {
        var element = layui.element;
    });
    var laydate;
    layui.use('laydate', function () {
        laydate = layui.laydate;
    });

    /**
     * 编辑产品
     * **/
    function updateProduct(id) {
        // alert(cInfoId);
        window.location.href = '<%=basePath %>CompanyInfoController/companyAddList.do?id=' + id;
    }

    /**
     * 删除新闻，传入要删除的新闻id
     */
    function deleteNews(id) {
        var dtv_confirm = layer.confirm('删除后不可恢复，您确定要删除此条信息吗？', {
            btn: ['删除', '取消'] //按钮
        }, function () {
            layer.close(dtv_confirm);
            iw.loading("删除中");
            $.post("<%=basePath %>CompanyInfoController/delBroadcasts.do?id=" + id, function (data) {
                iw.loadClose();
                if (data.result == '1') {
                    parent.iw.msgSuccess("删除成功");
                    location.reload();
                } else if (data.result == '0') {
                    parent.iw.msgFailure(data.info);
                } else {
                    parent.iw.msgFailure();
                }
            });
        }, function () {
        });
    }

</script>

${autoJumpTemplateEdit}

</body>
</html>